<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "product".
 *
 * @property int $id ID
 * @property string $name 名称
 * @property string $adoption_start_date 领养时间
 * @property string $adoption_end_date 领养结束时间
 * @property int $days 收益时间
 * @property string $earnings 收益  1000
 * @property int $energy 活力值-预约
 * @property int $un_app_energy 未预约活力值
 * @property int $status 1=立即预约  2=以预约  3=立即领养  4=生产中  0=无效
 * @property string $ctime 创建时间
 * @property string $utime 更新时间
 * @property string $img_url 图像链接
 * @property string $max_num 收益最大值
 * @property string $min_num 收益最小值
 */
class Product extends \yii\db\ActiveRecord {
    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return 'product';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['ctime', 'utime'], 'required'],
            [['ctime', 'utime'], 'safe'],
            [['days', 'energy', 'un_app_energy', 'status'], 'integer'],
            [['name', 'earnings'], 'string', 'max' => 30],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'adoption_start_date' => 'Adoption Start Date',
            'adoption_end_date' => 'Adoption End Date',
            'days' => 'Days',
            'earnings' => 'Earnings',
            'energy' => 'Energy',
            'un_app_energy' => 'Un App Energy',
            'status' => 'Status',
            'ctime' => 'Ctime',
            'utime' => 'Utime',
        ];
    }
}
